<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<ul id="ul01"><li>苹果</li><li>鸭梨</li><li>葡萄</li></ul>
		<button type="button" onclick="del()">删除</button>
		<script type="text/javascript">
			function del() {
				console.log("del()")
				if (ul01.hasChildNodes()) {
					ul01.removeChild(ul01.lastChild)
				}
			}
		</script>
	</body>
</html>
